package models

import (
	"time"
	"github.com/astaxie/beego/orm"
)

type Contributions struct {
	Id                   int
	Title                string        `ht:"list;search;name(标题)"`
	Author               string        `ht:"list;name(作者)"`
	ContributionType     int        `orm:"default(0)" ht:"name(投稿类型)"`
	EditTime             time.Time     `ht:"list;name(编辑时间);defaultvalue(time.Now())"`
	CreateTime           time.Time     `ht:"hide;defaultvalue(time.Now())"`
	Introduction         string        `ht:"name(简介)"`
	ListPicPath          string        `ht:"name(列表页图片);hide;type(pic)"`
	Content              string        `orm:"type(text)" ht:"type(mutitext);name(内容)"`
	Status               int           `ht:"list;status([{\"Num\":0,\"Name\":\"未审核\"},{\"Num\":1,\"Name\":\"删除\"},{\"Num\":2,\"Name\":\"初审\"},{\"Num\":3,\"Name\":\"发布\"}]);name(状态)"` //0:init;1:delete;2:publish
	RecommendToUserApear int           `ht:"hide;name(推荐)"`
	Sex                  string        `ht:"name(性别);enum([{\"Key\":\"男\",\"Value\":\"男\"},{\"Key\":\"女\",\"Value\":\"女\"}])"`
	Province             string           `ht:"name(省份);list"`
	Address              string           `ht:"name(地址)"`
	ZipCode              string           `ht:"name(邮编)"`
	Phone                string           `ht:"name(手机号)"`
	WeiboAddr            string           `ht:"name(微博地址)"`
	Mail                 string           `ht:"name(邮箱)"`
	Weixin               string           `ht:"name(微信)"`
	Fax                  string           `ht:"name(传真)"`
	QQ                   string           `ht:"name(QQ)"`
	BrowseCount          int            `ht:"hide;name(浏览人数)"`
	StartCount           int            `ht:"hide;name(点赞人数)"`
	WatchCount           int            `ht:"hide;name(收藏人数)"`
	UserId               int            `ht:"hide;name(发表者Id)"`
	CityId               int            `ht:"hide;name(所在地Id)"`
}

func init() {
	orm.RegisterModel(new(Contributions))
}
func (*Contributions)TableName() string {
	return "contributions"
}
func (*Contributions) FN_Id() string {
	return "Id"
}
func (*Contributions) FN_Title() string {
	return "Title"
}
func (*Contributions) FN_Author() string {
	return "Author"
}
func (*Contributions) FN_EditTime() string {
	return "EditTime"
}
func (*Contributions) FN_CreateTime() string {
	return "CreateTime"
}
func (*Contributions) FN_Introduction() string {
	return "Introduction"
}
func (*Contributions) FN_ListPicPath() string {
	return "ListPicPath"
}
func (*Contributions) FN_Content() string {
	return "Content"
}
func (*Contributions) FN_Status() string {
	return "Status"
}
func (*Contributions) FN_RecommendToUserApear() string {
	return "RecommendToUserApear"
}
func (*Contributions) FN_Sex() string {
	return "Sex"
}
func (*Contributions) FN_Province() string {
	return "Province"
}
func (*Contributions) FN_Address() string {
	return "Address"
}
func (*Contributions) FN_ZipCode() string {
	return "ZipCode"
}
func (*Contributions) FN_Phone() string {
	return "Phone"
}
func (*Contributions) FN_WeiboAddr() string {
	return "WeiboAddr"
}
func (*Contributions) FN_Mail() string {
	return "Mail"
}
func (*Contributions) FN_Weixin() string {
	return "Weixin"
}
func (*Contributions) FN_Fax() string {
	return "Fax"
}
func (*Contributions) FN_QQ() string {
	return "QQ"
}
func (*Contributions) FN_BrowseCount() string {
	return "BrowseCount"
}
func (*Contributions) FN_StartCount() string {
	return "StartCount"
}
func (*Contributions) FN_WatchCount() string {
	return "WatchCount"
}
func (*Contributions) FN_UserId() string {
	return "UserId"
}
func (*Contributions) FN_CityId() string {
	return "CityId"
}
